package tools

func StringSliceIsContain(items []string, item string) bool {
	for _, eachItem := range items {
		if eachItem == item {
			return true
		}
	}
	return false
}
func StringSlicesIsContain(items []string, items1 []string) bool {
	for _, eachItem := range items {
		for _, eachItem1 := range items1 {
			if eachItem == "0" || eachItem1 == "0" {
				continue
			}
			if eachItem == eachItem1 {
				return true
			}
		}
	}
	return false
}

// RemoveDuplicateElement 去除重复元素
func RemoveDuplicateElement(items []string) []string {
	result := make([]string, 0, len(items))
	temp := map[string]struct{}{}
	for _, item := range items {
		if _, ok := temp[item]; !ok {
			temp[item] = struct{}{}
			result = append(result, item)
		}
	}
	return result
}